﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace University.Workshop.Model.CardGame
{
    [Serializable]
    public class PokerHand
    {
        private Deck DeckCards;
        private Collection<Card> Hand;

        public PokerHand(Deck deck)
        {
            this.DeckCards = deck;
            this.Hand = new Collection<Card>();
        }

        public void PullCards()
        {
            for (int Pointer = 0; Pointer < 5; ++Pointer)
            {
                Hand.Add(DeckCards.PullCard());
            }
        }

        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            foreach (Card ptrCard in Hand)
            {
                stringBuilder.Append(ptrCard);
                stringBuilder.Append(", ");
            }
            return stringBuilder.ToString();
        }

        public Card this[int index]
        {
            get
            {
                return Hand[index];
            }
        }
    }
}
